<script>
	export default {
		onLaunch: function() {
			// 设置全局打印为空
			// console.log = () => {};
			console.log('App Launch');

			const updateManager = wx.getUpdateManager()

			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				console.log(res.hasUpdate)
			})

			updateManager.onUpdateReady(function() {
				wx.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success: function(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate()
						}
					}
				})
			})

			updateManager.onUpdateFailed(function() {
				// 新版本下载失败
			})

			let menuButtonObject = wx.getMenuButtonBoundingClientRect();
			wx.getSystemInfo({
				success: res => {
					// 导航高度
					let statusBarHeight = res.statusBarHeight,
						navTop = 0,
						navBottom = 0,
						// 胶囊按钮与右侧的距离=windowWidth-right+胶囊宽度
						navObjWid = res.windowWidth - menuButtonObject.right + menuButtonObject.width,
						navHeight = menuButtonObject.height + menuButtonObject.height + (menuButtonObject
							.top - statusBarHeight) * 2;
					// navHeight = res.system;
					if (res.system.toLowerCase()?.indexOf('android') >= 0 || res.system.toLowerCase()
						?.indexOf('ios') >= 0) {
						navTop = menuButtonObject.top;
						navBottom = (menuButtonObject.bottom + 10);
					}
					this.globalData.navTop = navTop; //胶囊距离顶部距离
					this.globalData.navHeight = navHeight; //胶囊高度 
					this.globalData.navBottom = navBottom; //导航栏底部高度
					this.globalData.navObj = menuButtonObject.height; //胶囊高度
					this.globalData.navObjWid = navObjWid; //胶囊宽度（包括右边距离)
					this.globalData.windowWidth = res.windowWidth;
					this.globalData.windowHeight = res.windowHeight;
					console.log(res,this.globalData,"0000000000000000000")
				},
				fail(err) {
					console.log(err)
				}
			})


		},
		onShow: function() {
			console.log('App Show');
			/* 阿里巴巴图标js 引入 */
			/* let domModule = weex.requireModule('dom');
				domModule.addRule('fontFace', {
					fontFamily: 'iconfont',
					src: "url('http://at.alicdn.com/t/c/font_3894563_dusjxa6y16.woff?t=1676343545069.ttf')"
				}); */
		},
		onHide: function() {
			console.log('App Hide');
		},
		data() {
			return {
				globalData: {},
				
			};
		},
	};
</script>

<style lang="scss">
	@import './static/assets/stylesheet.css';
	@import url('./common/css/iconfont.css');
	@import url('common/css/sun.css');
	@import url('common/css/public.css');
	@import url('common/css/page.css'); 

	view {
		font-size: 28rpx;
		color: #000000;
		// font-family: '阿里巴巴普惠体 2.0 95 ExtraBold';
	}

	text {
		font-size: 28rpx;
		// font-family: '阿里巴巴普惠体 2.0 95 ExtraBold';
	}



	page {
		/* 全局页面样式 */
		/* padding-bottom: 0; */
		/* 设置css iphonex适配  全局变量*/
		padding-bottom: constant(safe-area-inset-bottom);
		/* 兼容 iOS < 11.2 */
		padding-bottom: env(safe-area-inset-bottom);
		/* 兼容 iOS >= 11.2 */

		body,
		html {
			overflow-x: hidden;
		}

		body::-webkit-scrollbar {
			display: none;
		}

		/* #ifdef MP-WEIXIN || APP-PLUS */
		::-webkit-scrollbar {
			display: none;
			width: 0 !important;
			height: 0 !important;
			-webkit-appearance: none;
			background: transparent;
			color: transparent;
		}

		/* #endif */
		uni-scroll-view .uni-scroll-view::-webkit-scrollbar {
			/* 隐藏滚动条，但依旧具备可以滚动的功能 */
			display: none;
			width: 0 !important;
			height: 0 !important;
			-webkit-appearance: none;
			background: transparent;
			color: transparent;
		}
	}

	//联系我们
	.v-contact-us {
		margin-top: 16rpx;

		image {
			width: 710rpx;
			// height: 140rpx;
			height: auto;
			border-radius: 10rpx;
		}
	}

	.border10 {
		border-radius: 10rpx;
	}

	.border20 {
		border-radius: 10rpx;
	}

	.bottom-border {
		height: 6rpx;
		width: 750rpx;
		box-shadow: 0 -8rpx 8rpx rgba(0, 0, 0, 0.1);
		position: fixed;
		bottom: -4rpx;
		z-index: 9999;
		background: #fff;
	}

	.bottom-border2 {
		position: fixed;
		bottom: 112rpx;
		height: 6rpx;
		width: 750rpx;
		box-shadow: 0 -8rpx 8rpx rgba(0, 0, 0, 0.1);
		z-index: 990;
		background: #fff;
	}

	.input-class {
		color: #8f8f8f;
	}

	.colorA1 {
		color: #a1a1a1;
	}

	.textLine {
		text-decoration: line-through;
	}

	.red {
		color: #ff5f4e;
	}

	.blue {
		color: #294d7d;
	}

	// “客服”公共样式
	.customer-service {
		padding: 0 52rpx 0 40rpx;

		image {
			width: 50rpx;
			height: 50rpx;
		}

		text {
			color: #294d7d;
			font-size: 24rpx;
			margin-top: 6rpx;
		}
	}

	.padding-left {
		padding-left: 40rpx;
	}

	.fixed {
		background-color: #fff;
		z-index: 999;
		position: fixed;
		bottom: 0;
		right: 0;
		width: 100%;
	}

	.cancel,
	.pay {
		height: 112rpx;
		padding: 0 80rpx;
		font-size: 36rpx;
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.cancel {
		background: #d9d9d9;
		color: #8f8f8f;
	}

	.pay {
		color: #ffffff;
		background: #294d7d;
	}

	.border-bottom {
		border-bottom: 2rpx solid #f7f7f7;
	}

	.v-img-padding {
		padding: 20rpx;
	}

	.v-nedd-height {
		width: 100%;
		background-color: #fff;
		height: 130rpx;
	}

	.v-need-btn {
		z-index: 999;
		width: 90%;
		margin: 0 5%;
		height: 88rpx;
		color: #ffffff;
		font-size: 32rpx;
		font-weight: bold;
		background: #294d7d;
		position: fixed;
		bottom: 34rpx;
	}

	.v-height {
		width: 100%;
		background: #f7f7f7;
		height: 10rpx;
	}

	.v-height2 {
		width: 100%;
		background: #f7f7f7;
		height: 20rpx;
	}

	.v-group-bj {
		color: #ffffff;
		background: #fea751;
		padding: 4rpx 10rpx;
		font-size: 24rpx;
	}

	.v-bold {
		font-weight: bold;
	}

	.color-fff {
		color: #ffffff;
	}

	.bjfff {
		background-color: #fff;
	}

	.color3 {
		color: #333;
	}

	.colord9 {
		color: #d9d9d9;
	}

	.v-fontsize32 {
		font-size: 32rpx;
	}

	.v-fontsize24 {
		font-size: 24rpx;
	}

	.v-view-width {
		width: 750rpx;
	}

	.size20 {
		font-size: 20rpx;
	}

	.size40 {
		font-size: 40rpx;
	}

	.width100 {
		width: 100%;
	}

	.flex1 {
		flex: 1;
	}

	.btnCss2 {
		color: #ffffff;
		font-size: 36rpx;
		background: #294d7d;
		width: 520rpx;
		height: 112rpx;
	}

	.v-price-all {
		flex: 1;
		color: #8f8f8f;

		text {
			color: #ff3326;
		}
	}

	.sticky {
		position: sticky;
		top: 0;
		z-index: 999;
	}

	.btncss {
		margin: 0rpx;
		padding: 0rpx;
		background-color: #fff;
		all: unset;
		/* 重置所有样式 */
		background: none;
		/* 去掉背景 */
		border: none;
		/* 去掉边框 */
		padding: 0;
		/* 去掉内边距 */
		font: inherit;
		/* 继承父元素的字体样式 */
		cursor: pointer;
	}

	/*每个页面公共css */
	.flex {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.flex-column {
		display: flex;
		flex-direction: column;
		justify-content: center;
		align-items: center;
	}

	.flex-columns {
		display: flex;
		flex-direction: column;
	}

	.flex-align-center {
		display: flex;
		align-items: center;
	}

	// 回到首页按钮
	.v-index-icon {
		background-color: #fff;
		z-index: 999;
		position: fixed;
		bottom: 22%;
		right: 32rpx;
		width: 50rpx;
		height: 50rpx;
	}

	.flex-bottom {
		display: flex;
		align-items: flex-end;
	}

	.flex-end {
		display: flex;
		align-items: center;
		justify-content: flex-end;
	}

	.flex-between {
		display: flex;
		justify-content: space-between;
		align-items: center;
	}

	.flex-betweens {
		display: flex;
		justify-content: space-between;
	}

	.flex-around {
		display: flex;
		justify-content: space-around;
		align-items: center;
	}

	.flex-wrap {
		display: flex;
		flex-wrap: wrap;
	}

	/* 3行文字省略 */
	.font-overflow3 {
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 3;
		overflow: hidden;
		-webkit-box-orient: vertical;
	}

	/* 2行文字省略 */
	.font-overflow2 {
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		overflow: hidden;
		-webkit-box-orient: vertical;
	}

	/* 单行文字省略 */
	.font-overflow {
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
	}
</style>